if SERVER then
	registerCommand("givearmor", "Gives the amount of armor you specify to the player you designate - defaults to yourself if you leave out the player - player comes before value", function(param)
		local armorMsg = "caller gave target amount armor"
		if param["settings"]["givearmor_msg"] then
			armorMsg = param["settings"]["givearmor_msg"]
		end
		local armorTable = {}
		armorTable["caller"] = getCaller(param[1])
		if param[3] != nil && param[3] != "" then
			local targs = string.Explode(" ", param[3])
			local amount = tonumber(table.remove(targs, table.Count(targs)))
			if not amount then
				return nil
			end
			if table.Count(targs) >= 1 then
				for i, targ in pairs(targs) do
					local plyTarg = getPlayerByName(targ)
					if plyTarg then
						armorTable["target"] = plyTarg:GetName()
						local plyamount = amount
						if plyTarg:Armor() + plyamount > 99999 then
							plyamount = 99999 - plyTarg:Armor()
						end
						if plyTarg:Armor() + plyamount <= 0 then
							plyamount = plyTarg:Armor() * -1
						end
						armorTable["amount"] = plyamount
						
						display(param[1], "givearmor", { plyTarg } , parseDisplayMessage(armorMsg, armorTable))
						plyTarg:SetArmor(plyTarg:Armor() + plyamount)
					end
				end
			else
				if not param[1]:IsValid() then
					return nil
				end
				armorTable["target"] = param[1]:GetName()
				if param[1]:Armor() + amount > 99999 then
					amount = 99999 - param[1]:Armor()
				end
				if param[1]:Armor() + amount <= 0 then
					amount = param[1]:Armor() * -1
				end
				armorTable["amount"] = amount
				
				display(param[1], "givearmor", { nil } , parseDisplayMessage(armorMsg, armorTable))
				param[1]:SetArmor(param[1]:Armor() + amount)
			end
		end
	end)
end